#define _CRT_SECURE_NO_WARNINGS 1
#include <stdio.h>

int main() {
    int n = 0;
    scanf("%d", &n);
    int sum = 1;
    int k = 0;
    for (int i = 1; i <= n; i++)
    {
        sum = sum * i;
        k = k + sum;
    }
    printf("%d", k);
    return 0;
}